package com.bishe.demo.modules.other.dao;

import com.bishe.demo.modules.other.entity.UserTravel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface UserTravelDao {
    @Insert("insert into other_user_travel values(null,#{userId},#{travelId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertUserTravel(UserTravel userTravel);

    @Delete("delete from other_user_travel where user_id=#{userId}")
    void deleteUserTravelByUserId(int userId);

    @Delete("delete from other_user_travel where travel_id=#{travelId}")
    void deleteUserTravelByTravelId(int travelId);
}
